make_diff<-function(expFile,baseOut,condList){
  require(DESeq2)
  data<-read.table(expFile,header = 1,sep = "\t",row.names = 1);
  for(a in condList){
    for(b in condList){
      if(a<b){
        c=data.frame(c=c(a,a,b,b),row.names = c(
          paste(a,"1",sep = ""),paste(a,"2",sep = ""),
          paste(b,"1",sep = ""),paste(b,"2",sep = "")
        ))
        print(c);
        dds<-DESeqDataSetFromMatrix(data[,rownames(c)],design = ~c,colData = c);
        dde<-DESeq(dds);
        r<-results(dde,contrast = c("c",b,a));
        r<-r[apply(r,1,function(v){!any(is.na(v))}),]
        r[,"Regulation"]<-"UnReg"
        r[(r$log2FoldChange>log2(1.25))&(r$pvalue<0.001),"Regulation"]<-"UpHC"
        r[(r$log2FoldChange<(-log2(1.25)))&(r$pvalue<0.001),"Regulation"]<-"DownHC"
        write.table(r,file = sprintf("%s/%sVS%s.txt",baseOut,a,b),row.names = T,col.names = T,sep = "\t",quote = F);
      }
    }
  }
}

